/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.eurotrader.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Edmilson
 */
@Entity
@Table(name = "logoperacoes")
@NamedQueries({
    @NamedQuery(name = "Logoperacoes.findAll", query = "SELECT l FROM Logoperacoes l"),
    @NamedQuery(name = "Logoperacoes.findById", query = "SELECT l FROM Logoperacoes l WHERE l.id = :id"),
    @NamedQuery(name = "Logoperacoes.findByDataOperacao", query = "SELECT l FROM Logoperacoes l WHERE l.dataOperacao = :dataOperacao"),
    @NamedQuery(name = "Logoperacoes.findByHoraOperacao", query = "SELECT l FROM Logoperacoes l WHERE l.horaOperacao = :horaOperacao"),
    @NamedQuery(name = "Logoperacoes.findByOperacao", query = "SELECT l FROM Logoperacoes l WHERE l.operacao = :operacao"),
    @NamedQuery(name = "Logoperacoes.findByRegistroId", query = "SELECT l FROM Logoperacoes l WHERE l.registroId = :registroId"),
    @NamedQuery(name = "Logoperacoes.findByTabela", query = "SELECT l FROM Logoperacoes l WHERE l.tabela = :tabela")})
public class Logoperacoes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dataOperacao")
    @Temporal(TemporalType.DATE)
    private Date dataOperacao;
    @Basic(optional = false)
    @NotNull
    @Column(name = "horaOperacao")
    @Temporal(TemporalType.TIME)
    private Date horaOperacao;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 40)
    @Column(name = "operacao")
    private String operacao;
    @Size(max = 15)
    @Column(name = "registro_id")
    private String registroId;
    @Size(max = 50)
    @Column(name = "tabela")
    private String tabela;
    @JoinColumn(name = "usuario_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Usuario usuario;

    public Logoperacoes() {
    }

    public Logoperacoes(Integer id) {
        this.id = id;
    }

    public Logoperacoes(Integer id, Date dataOperacao, Date horaOperacao, String operacao) {
        this.id = id;
        this.dataOperacao = dataOperacao;
        this.horaOperacao = horaOperacao;
        this.operacao = operacao;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDataOperacao() {
        return dataOperacao;
    }

    public void setDataOperacao(Date dataOperacao) {
        this.dataOperacao = dataOperacao;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }        

    public Date getHoraOperacao() {
        return horaOperacao;
    }

    public void setHoraOperacao(Date horaOperacao) {
        this.horaOperacao = horaOperacao;
    }

    public String getOperacao() {
        return operacao;
    }

    public void setOperacao(String operacao) {
        this.operacao = operacao;
    }

    public String getRegistroId() {
        return registroId;
    }

    public void setRegistroId(String registroId) {
        this.registroId = registroId;
    }

    public String getTabela() {
        return tabela;
    }

    public void setTabela(String tabela) {
        this.tabela = tabela;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Logoperacoes)) {
            return false;
        }
        Logoperacoes other = (Logoperacoes) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.eurotrader.entidades.Logoperacoes[ id=" + id + " ]";
    }
    
}
